//
//  ToolBarViewController.swift
//  UI
//
//  Created by admin on 14/9/22.
//  Copyright (c) 2014年 sinosun. All rights reserved.
//

import UIKit

class ToolBarViewController: UIViewController {

    @IBOutlet weak var toolbar: UIToolbar!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
        self.toolbar.backgroundColor = UIColor.whiteColor()
        

        var barButtonItem1 = UIBarButtonItem(image: UIImage(named: "1410769630_basics-09-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        barButtonItem1.tintColor = UIColor.redColor()
        var barButtonItem2 = UIBarButtonItem(image: UIImage(named: "1410769572_basics-01-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        var barButtonItem3 = UIBarButtonItem(image: UIImage(named: "1410769581_basics-04-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        var barButtonItem4 = UIBarButtonItem(image: UIImage(named: "1410769606_basics-11-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        var barButtonItem5 = UIBarButtonItem(image: UIImage(named: "1410769620_basics-23-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        var barButtonItem6 = UIBarButtonItem(image: UIImage(named: "1410769626_basics-12-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        var barButtonItem7 = UIBarButtonItem(image: UIImage(named: "1410769481_basics-05-20"), style: UIBarButtonItemStyle.Plain, target: self, action: "barButtonItemClicked:")
        
        var barButtonItem_space = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FixedSpace, target: nil, action: nil)
        barButtonItem_space.width = 10
        
        var tabbars: [UIBarButtonItem]! = [barButtonItem_space,barButtonItem1,
            barButtonItem_space,barButtonItem2,
            barButtonItem_space,barButtonItem3,
            barButtonItem_space,barButtonItem4,
            barButtonItem_space,barButtonItem5,
            barButtonItem_space,barButtonItem6,
            barButtonItem_space,barButtonItem7,barButtonItem_space]
        
        
        self.toolbar.items = tabbars
        
        
        
    }
    
    func barButtonItemClicked(sender : AnyObject){
        println("barButtonItemClicked")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
